// 全局样式文件

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 通用工具类
.flex {
  display: flex;
  
  &.flex-column {
    flex-direction: column;
  }
  
  &.flex-center {
    align-items: center;
    justify-content: center;
  }
  
  &.flex-between {
    justify-content: space-between;
  }
  
  &.flex-around {
    justify-content: space-around;
  }
  
  &.flex-wrap {
    flex-wrap: wrap;
  }
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

// 间距工具类
@for $i from 0 through 10 {
  .m-#{$i} {
    margin: #{$i * 4}px;
  }
  
  .mt-#{$i} {
    margin-top: #{$i * 4}px;
  }
  
  .mr-#{$i} {
    margin-right: #{$i * 4}px;
  }
  
  .mb-#{$i} {
    margin-bottom: #{$i * 4}px;
  }
  
  .ml-#{$i} {
    margin-left: #{$i * 4}px;
  }
  
  .p-#{$i} {
    padding: #{$i * 4}px;
  }
  
  .pt-#{$i} {
    padding-top: #{$i * 4}px;
  }
  
  .pr-#{$i} {
    padding-right: #{$i * 4}px;
  }
  
  .pb-#{$i} {
    padding-bottom: #{$i * 4}px;
  }
  
  .pl-#{$i} {
    padding-left: #{$i * 4}px;
  }
}

// 颜色工具类
.text-primary {
  color: #409eff;
}

.text-success {
  color: #67c23a;
}

.text-warning {
  color: #e6a23c;
}

.text-danger {
  color: #f56c6c;
}

.text-info {
  color: #909399;
}

.text-muted {
  color: #999;
}

// 背景颜色工具类
.bg-primary {
  background-color: #409eff;
}

.bg-success {
  background-color: #67c23a;
}

.bg-warning {
  background-color: #e6a23c;
}

.bg-danger {
  background-color: #f56c6c;
}

.bg-info {
  background-color: #909399;
}

// 边框工具类
.border {
  border: 1px solid #dcdfe6;
}

.border-top {
  border-top: 1px solid #dcdfe6;
}

.border-right {
  border-right: 1px solid #dcdfe6;
}

.border-bottom {
  border-bottom: 1px solid #dcdfe6;
}

.border-left {
  border-left: 1px solid #dcdfe6;
}

.border-none {
  border: none;
}

// 圆角工具类
.rounded {
  border-radius: 4px;
}

.rounded-sm {
  border-radius: 2px;
}

.rounded-lg {
  border-radius: 8px;
}

.rounded-circle {
  border-radius: 50%;
}

// 阴影工具类
.shadow {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}

.shadow-lg {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

// 隐藏/显示工具类
.hidden {
  display: none;
}

.invisible {
  visibility: hidden;
}

.visible {
  visibility: visible;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
  
  &:hover {
    background: #a8a8a8;
  }
}

// 清除浮动
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}